import Vue from "vue";
import VueRouter from "vue-router";
import { post } from "../lib/axios";
import global from "../lib/global.vue";

Vue.use(VueRouter);

if (process.env.NODE_ENV == "development") {
    // localStorage.clear()
    // localStorage.setItem("userInfo", '{"userId":"og0Oljldv06X0tlIVf8cSCQDZJrE","password":"og0Oljldv06X0tlIVf8cSCQDZJrEmember"}'); // 溪风
    localStorage.setItem("token", "LiWeiPeng"); // 溪风
    // localStorage.setItem("wx_member_id", "wmIeQ-CQAAhxaX6kPblIsKLGv2lWO5BA"); // 望舒 教育模块
    // localStorage.setItem("wx_member_id", "wmIeQ-CQAAHRenF-7wcgcLcgk5oD31mA"); // 大梦
    // localStorage.setItem("wx_member_id", "wmIeQ-CQAA3P_xUFZKlTCDBmxTmjzEUA"); // 溪风
    // localStorage.setItem("wx_member_id", "wmIeQ-CQAA79-kRXiyJC-ff0-bjkGI6w"); // 虚竹
    localStorage.setItem("wx_member_id", "wmIeQ-CQAA3GZaqZqTMBn1lgR0BIFgKw"); // 王靖雯
    // localStorage.setItem("wx_member_id", "wmIeQ-CQAAt5awCK-pxoLmObPFPlasag"); // 沙琪 客服人力资源
}

const Routers = [{
        path: "*",
        name: "*",
        meta: {
            title: "首页",
            keepAlive: false
        },
        component: resolve => require(["@/views/Home"], resolve)
    },
    {
        path: "/",
        name: "/",
        meta: {
            title: "首页",
            keepAlive: false
        },
        component: resolve => require(["@/views/Home"], resolve)
    },
    {
        path: "/limited",
        name: "limited",
        meta: {
            title: "暂无权限",
            keepAlive: false
        },
        component: resolve => require(["@/views/limited"], resolve)
    },
    {
        path: "/notData",
        name: "notData",
        meta: {
            title: "暂无客户信息",
            keepAlive: false
        },
        component: resolve => require(["@/views/notData"], resolve)
    },
    {
        path: "/classify",
        name: "classify",
        meta: {
            title: "分类菜单",
            keepAlive: false
        },
        component: resolve => require(["@/views/classify"], resolve)
    },
    {
        path: "/business",
        name: "business",
        meta: {
            title: "业务",
            keepAlive: false
        },
        component: resolve => require(["@/views/business/tabMenu"], resolve),
        redirect: "/business/insurance",
        children: [{
                // 保险
                path: "insurance",
                name: "insurance",
                component: resolve =>
                    require(["@/views/business/insurance/insurance"], resolve)
            },
            {
                // 教育
                path: "education",
                name: "education",
                component: resolve =>
                    require(["@/views/business/education/education"], resolve)
            },
            {
                // 财税
                path: "finance",
                name: "finance",
                component: resolve =>
                    require(["@/views/business/finance/finance"], resolve)
            },
            {
                // 人力资源
                path: "human",
                name: "human",
                component: resolve => require(["@/views/business/human/human"], resolve)
            },
            {
                // 咨询类
                path: "consulting",
                name: "consulting",
                component: resolve =>
                    require(["@/views/business/consulting/consulting"], resolve)
            },
            {
                // 企业服务
                path: "enterpriseService",
                name: "enterpriseService",
                component: resolve =>
                    require([
                        "@/views/business/enterpriseService/enterpriseService"
                    ], resolve)
            }
        ]
    },
    {
        //业务-保险-编辑
        path: "/bxEditor",
        name: "bxEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/insurance/bxEditor"], resolve)
    },
    {
        //业务-保险-产品配置
        path: "/bxProdectConfig",
        name: "bxProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/insurance/bxProdectConfig"], resolve)
    },
    {
        //业务-保险-分配责任人
        path: "/bxAllocationPeople",
        name: "bxAllocationPeople",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/insurance/bxAllocationPeople"], resolve)
    },
    {
        //业务-保险-产品配置记录
        path: "/bxConfigHistory",
        name: "bxConfigHistory",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/insurance/bxConfigHistory"], resolve)
    },
    {
        //业务-人力资源-编辑
        path: "/rlEditor",
        name: "rlEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve => require(["@/views/business/human/rlEditor"], resolve)
    },
    {
        //业务-人力资源-产品配置
        path: "/rlProdectConfig",
        name: "rlProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/human/rlProdectConfig"], resolve)
    },
    {
        //业务-人力资源-产品配置记录
        path: "/rlConfigHistory",
        name: "rlConfigHistory",
        meta: {
            title: "产品配置记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/human/rlConfigHistory"], resolve)
    },
    {
        //业务-人力资源-分配责任人
        path: "/rlAllocationPeople",
        name: "rlAllocationPeople",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/human/rlAllocationPeople"], resolve)
    },
    {
        //业务-财税-信息编辑
        path: "/csEditor",
        name: "csEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/finance/csEditor"], resolve)
    },
    {
        //业务-财税-产品配置记录
        path: "/csConfigHistory",
        name: "csConfigHistory",
        meta: {
            title: "产品配置记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/finance/csConfigHistory"], resolve)
    },
    {
        //业务-财税-分配负责人
        path: "/csAllocationPeople",
        name: "csAllocationPeople",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/finance/csAllocationPeople"], resolve)
    },
    {
        //业务-财税-产品配置
        path: "/csProdectConfig",
        name: "csProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/finance/csProdectConfig"], resolve)
    },
    {
        //业务-咨询-信息编辑
        path: "/zxEditor",
        name: "zxEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/consulting/zxEditor"], resolve)
    },
    {
        //业务-咨询-产品配置记录
        path: "/zxConfigHistory",
        name: "zxConfigHistory",
        meta: {
            title: "产品配置记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/consulting/zxConfigHistory"], resolve)
    },
    {
        //业务-咨询-分配负责人
        path: "/zxAllocationPeople",
        name: "zxAllocationPeople",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/consulting/zxAllocationPeople"], resolve)
    },
    {
        //业务-咨询-产品配置
        path: "/zxProdectConfig",
        name: "zxProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/consulting/zxProdectConfig"], resolve)
    },
    {
        //业务-企业服务-信息编辑
        path: "/qyEditor",
        name: "qyEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/enterpriseService/qyEditor"], resolve)
    },
    {
        //业务-企业服务-产品配置记录
        path: "/qyConfigHistory",
        name: "qyConfigHistory",
        meta: {
            title: "产品配置记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/enterpriseService/qyConfigHistory"], resolve)
    },
    {
        //业务-企业服务-分配负责人
        path: "/qyAllocationPeople",
        name: "qyAllocationPeople",
        meta: {
            title: "分配负责人",
            keepAlive: false
        },
        component: resolve =>
            require([
                "@/views/business/enterpriseService/qyAllocationPeople"
            ], resolve)
    },
    {
        //业务-企业服务-产品配置
        path: "/qyProdectConfig",
        name: "qyProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/enterpriseService/qyProdectConfig"], resolve)
    },

    {
        //业务-教育-编辑
        path: "/jyEditor",
        name: "jyEditor",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/education/jyEditor"], resolve)
    },
    {
        //业务-教育-产品配置
        path: "/jyProdectConfig",
        name: "jyProdectConfig",
        meta: {
            title: "产品配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/education/jyProdectConfig"], resolve)
    },
    {
        //业务-教育-产品配置记录
        path: "/jyConfigHistory",
        name: "jyConfigHistory",
        meta: {
            title: "产品配置记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/business/education/jyConfigHistory"], resolve)
    },
    //客服中心
    {
        path: "/callCenter",
        name: "callCenter",
        meta: {
            title: "客服",
            keepAlive: false
        },
        component: resolve => require(["@/views/callCenter/tabMenu"], resolve),
        redirect: "/callCenter/kfInsurance",
        children: [{
                // 保险
                path: "kfInsurance",
                name: "kfInsurance",
                component: resolve =>
                    require(["@/views/callCenter/kfInsurance/kfInsurance"], resolve)
            },
            {
                // 财税
                path: "kfFinance",
                name: "kfFinance",
                component: resolve =>
                    require(["@/views/callCenter/kfFinance/kfFinance"], resolve)
            },
            {
                // 人力资源
                path: "kfHuman",
                name: "kfHuman",
                component: resolve =>
                    require(["@/views/callCenter/kfHuman/kfHuman"], resolve)
            },
            {
                // 咨询类
                path: 'kfConsulting',
                name: 'kfConsulting',
                component: resolve => require(['@/views/callCenter/kfConsulting/kfConsulting'], resolve)
            },
            {
                // 企业服务
                path: 'kfEnterpriseService',
                name: 'kfEnterpriseService',
                component: resolve => require(['@/views/callCenter/kfEnterpriseService/kfEnterpriseService'], resolve)
            },
        ]
    },
    {
        //客服-保险-订单信息
        path: "/kfOrderInfo",
        name: "kfOrderInfo",
        meta: {
            title: "信息编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfOrderInfo"], resolve)
    },
    {
        //客服-保险-订单信息
        path: "/kfconfirmInsurance",
        name: "kfconfirmInsurance",
        meta: {
            title: "确认投保",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfconfirmInsurance"], resolve)
    },
    {
        //客服-保险-订单信息
        path: "/kfOrderUserList",
        name: "kfOrderUserList",
        meta: {
            title: "投保人员",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfOrderUserList"], resolve)
    },
    {
        //客服-保险-新增员工
        path: "/kfStaffList",
        name: "kfStaffList",
        meta: {
            title: "新增员工",
            keepAlive: true
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfStaffList"], resolve)
    },
    {
        //客服-保险-新增员工
        path: "/kfAddStaff",
        name: "kfAddStaff",
        meta: {
            title: "新增员工",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfAddStaff"], resolve)
    },
    {
        //客服-保险-查看反馈信息
        path: "/kfFeedback",
        name: "kfFeedback",
        meta: {
            title: "查看反馈信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfInsurance/kfFeedback"], resolve)
    },

    {
        //客服-人力-人员配置
        path: "/kfHumanConfig",
        name: "kfHumanConfig",
        meta: {
            title: "人员配置",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfHuman/kfHumanConfig"], resolve)
    },
    {
        //客服-人力-人员池
        path: "/kfPeoplePoolList",
        name: "kfPeoplePoolList",
        meta: {
            title: "人员池",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfHuman/kfPeoplePoolList"], resolve)
    },
    {
        //客服-人力-新增员工
        path: "/kfHumanAdd",
        name: "kfHumanAdd",
        meta: {
            title: "新增员工",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfHuman/kfHumanAdd"], resolve)
    },
    {
        //客服-人力-上传合同
        path: "/kfHumanUpFile",
        name: "kfHumanUpFile",
        meta: {
            title: "上传合同",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/callCenter/kfHuman/kfHumanUpFile"], resolve)
    },


    // 财务中心
    {
        path: "/financial",
        name: "financial",
        meta: {
            title: "财务中心",
            keepAlive: false
        },
        component: resolve => require(["@/views/financial/tabMenu"], resolve),
        redirect: "/financial/jrInsurance",
        children: [{
                // 保险
                path: "jrInsurance",
                name: "jrInsurance",
                component: resolve =>
                    require(["@/views/financial/jrInsurance/jrInsurance"], resolve)
            },
            {
                // 教育
                path: "jrEducation",
                name: "jrEducation",
                component: resolve =>
                    require(["@/views/financial/jrEducation/jrEducation"], resolve)
            },
            {
                // 财税
                path: "jrFinancial",
                name: "jrFinancial",
                component: resolve =>
                    require(["@/views/financial/jrFinancial/jrFinancial"], resolve)
            },
            {
                // 人力资源
                path: "jrHuman",
                name: "jrHuman",
                component: resolve =>
                    require(["@/views/financial/jrHuman/jrHuman"], resolve)
            },
            {
                // 咨询
                path: "jrAdvisory",
                name: "jrAdvisory",
                component: resolve =>
                    require(["@/views/financial/jrAdvisory/jrAdvisory"], resolve)
            },
            {
                // 企业服务
                path: "jrEnterpriseService",
                name: "jrEnterpriseService",
                component: resolve =>
                    require(["@/views/financial/jrEnterpriseService/jrEnterpriseService"], resolve)
            },
        ]
    },
    {
        // 财务-确认开票 （保险之外）
        path: "/confirmInvoice",
        name: "confirmInvoice",
        meta: {
            title: "确认开票",
            keepAlive: false
        },
        component: resolve => require(["@/views/financial/confirmInvoice"], resolve)
    },
    {
        // 财务-确认开票 （保险）
        path: "/insuranceInvoice",
        name: "insuranceInvoice",
        meta: {
            title: "确认开票",
            keepAlive: false
        },
        component: resolve => require(["@/views/financial/insuranceInvoice"], resolve)
    },
    {
        // 财务-开票信息
        path: "/invoiceInfo",
        name: "invoiceInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve => require(["@/views/financial/invoiceInfo"], resolve)
    },
    {
        // 财务中心-保险-订单信息首页
        path: "/jrOrderInfo",
        name: "jrOrderInfo",
        meta: {
            title: "订单信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrInsurance/jrOrderInfo"], resolve)
    },
    {
        // 财务中心-保险-开票信息上传
        path: "/jrConfirmInvoice",
        name: "jrConfirmInvoice",
        meta: {
            title: "订单信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrInsurance/jrConfirmInvoice"], resolve)
    },
    {
        // 财务中心-保险-收款
        path: "/jrInsuranceMonye",
        name: "jrInsuranceMonye",
        meta: {
            title: "收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrInsurance/jrInsuranceMonye"], resolve)
    },
    //   {
    //     // 财务中心-保险-开票信息首页
    //     path: "/jrBillingInfo",
    //     name: "jrBillingInfo",
    //     meta: {
    //       title: "开票信息",
    //       keepAlive: false
    //     },
    //     component: resolve =>
    //       require(["@/views/financial/jrInsurance/jrBillingInfo"], resolve)
    //   },
    {
        // 财务中心-人力-确认收款页
        path: "/jrHumanConfirmMoney",
        name: "jrHumanConfirmMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrHuman/jrHumanConfirmMoney"], resolve)
    },
    {
        // 财务中心-人力-开票信息页
        path: "/jrHumanBillingInfo",
        name: "jrHumanBillingInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrHuman/jrHumanBillingInfo"], resolve)
    },
    {
        // 财务中心-保险-开票信息上传
        path: "/jrHumanConfirmInvoice",
        name: "jrHumanConfirmInvoice",
        meta: {
            title: "订单信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrHuman/jrHumanConfirmInvoice"], resolve)
    },
    {
        // 财务中心-财税-确认收款页
        path: "/jrFinancialConfirmMoney",
        name: "jrFinancialConfirmMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrFinancial/jrFinancialConfirmMoney"], resolve)
    },
    {
        // 财务中心-财税-开票信息页
        path: "/jrFinancialBillingInfo",
        name: "jrFinancialBillingInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrFinancial/jrFinancialBillingInfo"], resolve)
    },
    {
        // 财务中心-咨询-确认收款页
        path: "/jrAdvisoryConfirmMoney",
        name: "jrAdvisoryConfirmMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrAdvisory/jrAdvisoryConfirmMoney"], resolve)
    },
    {
        // 财务中心-咨询-开票信息页
        path: "/jrAdvisoryBillingInfo",
        name: "jrAdvisoryBillingInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrAdvisory/jrAdvisoryBillingInfo"], resolve)
    },
    {
        // 财务中心-咨询-开票信息上传
        path: "/jrAdvisoryInvoice",
        name: "jrAdvisoryInvoice",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrAdvisory/jrAdvisoryInvoice"], resolve)
    },
    {
        // 财务中心-企业服务-确认收款页
        path: "/jrESConfirmMoney",
        name: "jrESConfirmMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrEnterpriseService/jrESConfirmMoney"], resolve)
    },
    {
        // 财务中心-企业服务-开票信息页
        path: "/jrESBillingInfo",
        name: "jrESBillingInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrEnterpriseService/jrESBillingInfo"], resolve)
    },
    {
        // 财务中心-教育-确认收款页
        path: "/jrEduConfirmMoney",
        name: "jrEduConfirmMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrEducation/jrEduConfirmMoney"], resolve)
    },
    {
        // 财务中心-教育-开票信息页
        path: "/jrEduBillingInfo",
        name: "jrEduBillingInfo",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrEducation/jrEduBillingInfo"], resolve)
    },
    {
        // 财务中心-教育-查看详情
        path: "/jrEduDetail",
        name: "jrEduDetail",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/jrEducation/jrEduDetail"], resolve)
    },
    {
        // 财务中心-除保险以外-确认收款页
        path: "/otherMoney",
        name: "otherMoney",
        meta: {
            title: "确认收款",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/financial/otherMoney"], resolve)
    },
    {
        // 教育中心-首页
        path: "/educationHome",
        name: "educationHome",
        meta: {
            title: "开票信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/education/educationHome"], resolve)
    },
    {
        // 教育中心-查看详情
        path: "/educationDetail",
        name: "educationDetail",
        meta: {
            title: "查看详情",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/education/educationDetail"], resolve)
    },
    {
        // 教育中心-查看详情
        path: "/educationSet",
        name: "educationSet",
        meta: {
            title: "编辑信息",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/education/educationSet"], resolve)
    },
    {
        // 教育中心-打卡记录
        path: "/eduPunch",
        name: "eduPunch",
        meta: {
            title: "考勤打卡记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/education/eduPunch"], resolve)
    },
    {
        // 教育中心-打卡记录
        path: "/eduPunchRecord",
        name: "eduPunchRecord",
        meta: {
            title: "考勤记录",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/education/eduPunchRecord"], resolve)
    },
    {
        // 理赔中心
        path: "/claim",
        name: "claim",
        meta: {
            title: "理赔中心",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/claim/claim"], resolve)
    },
    {
        // 新增理赔
        path: "/addClaim",
        name: "addClaim",
        meta: {
            title: "新增理赔",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/claim/addClaim"], resolve)
    },
    {
        // 新增理赔
        path: "/setClaim",
        name: "setClaim",
        meta: {
            title: "编辑信息",
            keepAlive: true
        },
        component: resolve =>
            require(["@/views/claim/setClaim"], resolve)
    },
    {
        // 详情/编辑
        path: "/editorClaim",
        name: "editorClaim",
        meta: {
            title: "详情/编辑",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/claim/editorClaim"], resolve)
    },
    {
        // 理赔材料上传
        path: "/upInfoClaim",
        name: "upInfoClaim",
        meta: {
            title: "理赔材料上传",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/claim/upInfoClaim"], resolve)
    },
    {
        // 更改理赔状态
        path: "/changeStatusClaim",
        name: "changeStatusClaim",
        meta: {
            title: "理赔材料上传",
            keepAlive: false
        },
        component: resolve =>
            require(["@/views/claim/changeStatusClaim"], resolve)
    },
];

const RouterConfig = {
    base: "",
    mode: "hash",
    // mode: 'history',
    routes: Routers
};
const router = new VueRouter(RouterConfig);
router.beforeEach((to, from, next) => {
    let href = window.location.href;
    // if (href.indexOf('/#/') == -1) {
    //     let index = href.indexOf('#/');
    //     let newUrl = href.substring(index);
    //     // window.location.href = global.WEB_URL + newUrl
    //     window.location.href = 'http://localhost:8081/' + newUrl
    //     return;
    // }
    console.log("当前路径", href);
    next();
    return;
});
router.afterEach(() => {
    window.scrollTo(0, 0);
});

export default router;